//
//  MSCompanyView.m
//  觅尚
//
//  Created by No.8 on 2019/3/21.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSCompanyView.h"

@implementation MSCompanyView

/** 返回按钮*/
- (UIButton *)backButton {
    if (!_backButton) {
        _backButton = [[UIButton alloc] initWithFrame:CGRectMake(40 * px, 100 * px, 80 * px, 100 * px)];
        [_backButton setImage:[UIImage imageNamed:@"左箭头"] forState:UIControlStateNormal];
        [self addSubview:_backButton];
    }
    return _backButton;
}


/** 登录标题*/
- (UILabel *)title {
    if (!_title) {
        _title = [[UILabel alloc] init];
        _title.frame = CGRectMake(150 * px, 300 * px, 400 * px, 70 * px);
        _title.text  = @"完善个人信息";
        _title.textColor = [UIColor whiteColor];
        _title.font = [UIFont boldSystemFontOfSize:SYRealValue(38 / 2)];
        [self addSubview:_title];
        
    } 
    return _title;
}
/** 公司*/
- (UILabel *)companyLable {
    if (!_companyLable) {
        _companyLable = [[UILabel alloc] initWithFrame:CGRectMake(100 * px, CGRectGetMaxY(_title.frame) + 200 * px, 100 * px, 100 * px)];
        _companyLable.text = @"公司";
        _companyLable.textColor = [UIColor whiteColor];
        _companyLable.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    }
    return _companyLable;
}
/** 公司底部线*/
- (UIImageView *)companylineIMG {
    if (!_companylineIMG) {
        _companylineIMG = [[UIImageView alloc] initWithFrame:CGRectMake(_companyLable.x, CGRectGetMaxY(_companyLable.frame), ScreenWidth - 200 * px, 1)];
        _companylineIMG.image = [UIImage imageNamed:@"line"];
    }
    return _companylineIMG;
}

/** 公司按钮*/
- (UIButton *)companyButton {
    if (!_companyButton) {
        _companyButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _companyButton.frame = CGRectMake(ScreenWidth * 0.5, _companyLable.y, ScreenWidth * 0.3, 100 * px);
//        [_companyButton setImage:[UIImage imageNamed:@"选择箭头"] forState:UIControlStateNormal];
        [_companyButton setTitle:@"请选择" forState:UIControlStateNormal];
        [_companyButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//        _companyButton.backgroundColor = [UIColor redColor];
        _companyButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
        _companyButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    }
    return _companyButton;
}

/** 公司>*/
- (UIImageView *)companyArrowIMG {
    if (!_companyArrowIMG) {
        _companyArrowIMG = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_companyButton.frame), _companyButton.y + 25 * px, 50 * px, 50 * px)];
        _companyArrowIMG.image = [UIImage imageNamed:@"选择箭头"];
    }
    return _companyArrowIMG;
}
/** 部门*/
- (UILabel *)departmentLable {
    if (!_departmentLable) {
        _departmentLable = [[UILabel alloc] initWithFrame:CGRectMake(_companyLable.x, CGRectGetMaxY(_companylineIMG.frame) + 100 * px, _companyLable.width, _companyLable.height)];
        _departmentLable.text = @"部门";
        _departmentLable.textColor = [UIColor whiteColor];
        _departmentLable.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    }
    return _departmentLable;
}

/** 部门底部线*/
- (UIImageView *)departmentlineIMG {
    if (!_departmentlineIMG) {
        _departmentlineIMG = [[UIImageView alloc] initWithFrame:CGRectMake(_companylineIMG.x, CGRectGetMaxY(_departmentLable.frame), _companylineIMG.width, _companylineIMG.height)];
        _departmentlineIMG.image = [UIImage imageNamed:@"line"];
    }
    return _departmentlineIMG;
}


/** 部门按钮*/
- (UIButton *)departmentButton {
    if (!_departmentButton) {
        _departmentButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _departmentButton.frame = CGRectMake(_companyButton.x, _departmentLable.y, _companyButton.width, _companyButton.height);
//        [_departmentButton setImage:[UIImage imageNamed:@"选择箭头"] forState:UIControlStateNormal];
        [_departmentButton setTitle:@"请选择" forState:UIControlStateNormal];
        [_departmentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _departmentButton.contentHorizontalAlignment = _companyButton.contentHorizontalAlignment;
        _departmentButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    }
    return _departmentButton;
}


/** 部门>*/
- (UIImageView *)departmentArrowIMG {
    if (!_departmentArrowIMG) {
        _departmentArrowIMG = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_departmentButton.frame), _departmentButton.y + 25 * px, 50 * px, 50 * px)];
        _departmentArrowIMG.image = [UIImage imageNamed:@"选择箭头"];
    }
    return _departmentArrowIMG;
}

/** 角色*/
- (UILabel *)roleLable {
    if (!_roleLable) {
    _roleLable = [[UILabel alloc] initWithFrame:CGRectMake(_companyLable.x, CGRectGetMaxY(_departmentlineIMG.frame) + 100 * px, _companyLable.width, _companyLable.height)];
        _roleLable.text = @"职位";
    _roleLable.textColor = [UIColor whiteColor];
        _roleLable.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        
    }
    return _roleLable;
}





/** 角色底部线*/
- (UIImageView *)rolelineIMG {
    if (!_rolelineIMG) {
        _rolelineIMG = [[UIImageView alloc] initWithFrame:CGRectMake(_companylineIMG.x, CGRectGetMaxY(_roleLable.frame), _companylineIMG.width, _companylineIMG.height)];
        _rolelineIMG.image = [UIImage imageNamed:@"line"];
    }
    return _rolelineIMG;
}




/** 角色按钮*/
- (UIButton *)roleButton {
    if (!_roleButton) {
        _roleButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _roleButton.frame = CGRectMake(_companyButton.x, _roleLable.y, _companyButton.width, _companyButton.height);
//        [_roleButton setImage:[UIImage imageNamed:@"选择箭头"] forState:UIControlStateNormal];
        [_roleButton setTitle:@"请选择" forState:UIControlStateNormal];
        [_roleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _roleButton.contentHorizontalAlignment = _companyButton.contentHorizontalAlignment;
        _roleButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    }
    return _roleButton;
}

/** 公司>*/
- (UIImageView *)roleArrowIMG {
    if (!_roleArrowIMG) {
        _roleArrowIMG = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_roleButton.frame), _roleButton.y + 25 * px, 50 * px, 50 * px)];
        _roleArrowIMG.image = [UIImage imageNamed:@"选择箭头"];
    }
    return _roleArrowIMG;
}
- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateSubView];
        
    }
    return self;
}

/** 公司按钮*/
- (UIButton *)LoginButton {
    if (!_LoginButton) {
        _LoginButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _LoginButton.frame = CGRectMake(_rolelineIMG.x, CGRectGetMaxY(_rolelineIMG.frame) + 50 * px, _rolelineIMG.width, 120 * px);
        //        [_companyButton setImage:[UIImage imageNamed:@"选择箭头"] forState:UIControlStateNormal];
        [_LoginButton setTitle:@"确定" forState:UIControlStateNormal];
        _LoginButton.layer.cornerRadius = 60 * px;
        _LoginButton.layer.masksToBounds = YES;
        [_LoginButton setBackgroundImage:[UIImage imageNamed:@"底部按钮背景"] forState:UIControlStateNormal];
        [_LoginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _LoginButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        _LoginButton.titleLabel.font = [UIFont systemFontOfSize:SYRealValue(35 / 2)];
    }
    return _LoginButton;
}

- (void)CreateSubView{
    
    self.backgroundColor = [UIColor clearColor];
    
}

@end
